home *** CD-ROM | disk | FTP | other *** search
- Path: sdd.hp.com!inn
- From: Laura Mansfield <laura>
- Newsgroups: comp.lang.c++
- Subject: Re: C++ and dynamic loading of libraries
- Date: 2 Feb 1996 04:37:31 GMT
- Organization: Hewlett-Packard, San Diego
- Message-ID: <4es4eb$au7@news.sdd.hp.com>
- References: <4eq0ip$al9@s854803.kb.be>
- NNTP-Posting-Host: hpsdlgd6.sdd.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.12 (X11; I; HP-UX A.09.05 9000/730)
- X-URL: news:4eq0ip$al9@s854803.kb.be
-
- I'm not sure if this is what you're looking for, but it's something
- I've seen done in Windows. It's called run-time dynamic linking.
- If you wrote the C++ library that you're
- loading, you could add this to that code, or maybe include it the
- code that's using the library.
-
- I would use a table that maps a string which is the name of the function
- to the address of that function. You could use an entry point function
- in the library that would take as a parameter the string of the function
- name and return the pointer to that function. Or if you do write the
- library code, you have the address of the exported functions, and you
- could write your own function and table to accomplish this.
-
- u19809@kb.be (Wim Delvaux) wrote:
- >I would like to be able to load libraries generated from C++ from
- >other C++ code. This is not a big problem but I would like to use the
- >libraries ON DEMAND ie. when the application needs it and not at
- >compile time. (Using LOADLIBRARY/FINDSYMBOL api calls of the dynamic
- >loader components of several OS-ses : Windows, Linux, Unix, ...)
- >
- >There is however the problem of the name mangling : What is the name
- >of the C++ function I need ?
- >
- >Does there exist (compiler-specific) API's to mangle/demangle that can
- >be used from within an application ?
- >Does anybody have other suggestions how to do this ?
- >
- >Thanx
- >
- >Wim Delvaux
- >
- >Wim Delvaux
- >Kredietbank NV.
- >Belgium
- >+ 32 (0)2 422 74 64
- >
-
- --
-
- ************************************************************************
-
- Laura C. Mansfield _/_/_/_/_/_/_/_/_/_/_/
- Hewlett-Packard Company _/ _/ _/
- San Diego Printer Division _/
- MS-60U360 _/_/_/_/_/ _/ _/ _/
- 16399 W. Bernardo Dr. _/ _/ _/ _/_/ _/_/
- San Diego, CA 92127-1899 _/_/_/_/_/ _/ _/ _/ _/
- _/ _/ _/ _/ _/
- _/ _/ _/ _/ _/
- _/
- Gig' Em Aggies! _/_/_/_/_/
-
-
- "Truth is more than an opposing point of view." - Susan Ashton
-
- ************************************************************************
-
-